package org.broadway.interfaces;

import org.broadway.exceptions.ActionException;

/***
 * This is a generic interface that represents an Action component.
 * The action can be used to implement the command parttern to delegate
 * execution of a specic task.  The action can also participate in callback
 * mechanism to handle asych tasks.
 * <br/><br/>
 * Implementation of an Action accepts a Context which provides data to
 * that is related to the execution of the action.
 * 
 * @author vmtters
 *
 */
public interface Action<RESULT> {
	/**
	 * This method implements the logic to execute an action. 
	 * The action should be independent from it's executor.
	 * It accepts a Context that provides instances of data related
	 * to the execution of the action.
	 * @param ctx
	 * @return RESULT a type containing result of executed action.
	 * @throws ActionException
	 */
	public RESULT execute(Context ctx) throws ActionException;
}
